package com.diandian.backend.dingding.data.param;

import com.diandian.backend.dingding.data.dto.DingdingDeptTreeExtendSyncParamDTO;
import com.diandian.base.boot.starter.exception.DefaultException;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class DingdingDeptTreeExtendSyncParam implements Serializable {

	private String deptCode;
	private String belong;
	private String syncUserId;
	private String syncUserName;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date syncTime;
	private String level;

	public void check(){
		if(this.belong == null || "".equals(this.belong)){
			throw new DefaultException("归属标识不能为空");
		}
		if(this.deptCode == null || "".equals(this.deptCode)){
			throw new DefaultException("部门编码不能为空");
		}
	}

	public DingdingDeptTreeExtendSyncParamDTO toDTO(){
		DingdingDeptTreeExtendSyncParamDTO dto = new DingdingDeptTreeExtendSyncParamDTO();
		dto.setDeptCode(this.deptCode);
		dto.setBelong(this.belong);
		dto.setSyncUserId(this.syncUserId);
		dto.setSyncUserName(this.syncUserName);
		dto.setSyncTime(this.syncTime);
		dto.setLevel(this.level);
		return dto;
	}

	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getSyncUserId() {
		return syncUserId;
	}

	public void setSyncUserId(String syncUserId) {
		this.syncUserId = syncUserId;
	}

	public String getSyncUserName() {
		return syncUserName;
	}

	public void setSyncUserName(String syncUserName) {
		this.syncUserName = syncUserName;
	}

	public Date getSyncTime() {
		return syncTime;
	}

	public void setSyncTime(Date syncTime) {
		this.syncTime = syncTime;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}
}
